package com.kinyx.examples.entities.impl;

import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

import org.hibernate.annotations.GenericGenerator;

import com.kinyx.examples.AttributeConverters.impl.GenderConverter;
import com.kinyx.examples.enums.impl.Gender;
import com.kinyx.framework.db.annotation.Comment;
import com.kinyx.framework.db.annotation.Order;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@Entity
@ToString
public class EnumEntity {

	@Id
	@GenericGenerator(name = "uuid", strategy = "uuid.hex")
	@GeneratedValue(generator = "uuid")
	@Column(nullable = false, updatable = false, length = 32)
	@Comment("主键")
	@Order(-10000)
	private String id;

	private Gender e1;
	@Enumerated(EnumType.ORDINAL)
	private Gender e2;
	@Enumerated(EnumType.STRING)
	private Gender e3;

	@Convert(converter = GenderConverter.class)
	public Gender ce;

}
